پرش به مطلب اصلی

Update Reseller Level API

POST /updateResellerLevel

Description

This API endpoint allows an admin to update the level or tier of a reseller by providing the reseller's ID and the new level details. The admin can update the discount percentage and minimum score required for that level.

Request Body

The request utilizes GraphQL to perform the updateResellerLevel mutation.

Mutation:

mutation updateResellerLevel ($id: Int!, $level: ResellerLevelEdit!) {
updateResellerLevel (id: $id, level: $level) {
id
name
discountPercent
minScore
}
}

Variables:

{
"id": 0,
"level": {
"discountPercent": "<Discount_Percent>",
"minScore": "<Min_Score>"
}
}
  • id (Int): The unique identifier of the reseller whose level is being updated.
  • level (ResellerLevelEdit Object): An object containing the updated level details.
    • discountPercent (String): The updated discount percentage for the reseller at this level.
    • minScore (String): The updated minimum score required for the reseller to attain this level.

Response:

  • Success (200 OK):

    • If the level update is successful, the response will return the updated reseller level details, including the ID, name, discount percentage, and minimum score.
    {
    "data": {
    "updateResellerLevel": {
    "id": "<Reseller_Level_ID>",
    "name": "<Reseller_Level_Name>",
    "discountPercent": "<Discount_Percent>",
    "minScore": "<Min_Score>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid reseller ID, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing reseller and that the level object contains valid and correctly formatted data. This API should be used by admins with the necessary permissions to manage and update reseller levels and their associated details.